; *** Vertical TicTacToe
; *** Copyright 1998-2002 Zillions Development
; v.2.0

; You need to purchase Zillions of Games to load this rules file
; Visit the Zillions web site at http://www.zillions-of-games.com
(translate
("Vertical TicTacToe 6x5" "四子棋 6x5")("Vertical TicTacToe 6x6" "四子棋 6x6")
("Vertical TicTacToe 7x5" "四子棋 7x5")("Vertical TicTacToe 7x6" "四子棋 7x6")
("Vertical TicTacToe 7x7" "四子棋 7x7")
("Vertical TicTacToe 8x5" "四子棋 8x5")("Vertical TicTacToe 8x6" "四子棋 8x6")
("Vertical TicTacToe 8x7" "四子棋 8x7")("Vertical TicTacToe 8x8" "四子棋 8x8")
)
(version "2.0")

(define pile ( $1 (while not-empty? n) add) )

(define common-grid-stuff
    (start-rectangle 1 1 45 45) ; top-left position
    (directions (n 0 -1) (e 1 0) (ne 1 -1) (nw -1 -1) (s 0 1))
)
(define common-piece-stuff
    (image Red "images\Vertical_TicTacToe\Shaag\red.bmp" "images\Vertical_TicTacToe\red.bmp"
           Black "images\Vertical_TicTacToe\Shaag\black.bmp" "images\Vertical_TicTacToe\black.bmp")
    (name checker)
	(help "棋子只能下落在一列里最下面的空格。")
)

(game
    (title "Vertical TicTacToe 6x5")
    (description "棋子只能落在一列中最下面的空格，如同下落一样。先将4个己方棋子横、竖或斜连成一线为胜。")
    (history "Also known as Gravitational TicTacToe and 4-in-a-row, this game has been
        marketed in a 7x6 version under the name Connect-4.")
    (strategy "Try to position your checkers to get as many `potential` 4-in-a-rows
        as possible, and use these threats to prevent your opponent from dropping
        into as as many columns as you can.    The best opening move for Red on
        boards with odd numbers of columns is to drop into the central column.\\
        Victor Allis, a Dutch computer scientist, proved in the late 1980's that Red
        has a forced win on the 7x6 board.")
    (option "prevent flipping" true)
    (drop-sound "Audio\\SlideDown.wav")
    (win-sound "Audio\\Congrats.wav")
    (loss-sound "Audio\\YouLose.wav")
    (players Red Black)
    (turn-order Red Black)
    (board
        (image "images\Vertical_TicTacToe\Shaag\VerticalTTT6x5.bmp" "images\Vertical_TicTacToe\VerticalTTT6x5.bmp")
        (grid
            (common-grid-stuff)
            (dimensions
                ("a/b/c/d/e/f" (45 0)) ; columns
                ("5/4/3/2/1" (0 45)) ; rows
			)
		)
	) 
    (piece
        (common-piece-stuff)
        (drops
            (pile a1) (pile b1) (pile c1) (pile d1) (pile e1) (pile f1)
		)
	)
    (board-setup
        (Red (checker off 99))
        (Black (checker off 99))
	)
    (win-condition (Red Black)
	  (or (relative-config checker n checker n checker n checker)
          (relative-config checker e checker e checker e checker)
          (relative-config checker ne checker ne checker ne checker)
          (relative-config checker nw checker nw checker nw checker)
	  )
	)
)

(variant
    (title "Vertical TicTacToe 6x6")
    (board
        (image "images\Vertical_TicTacToe\Shaag\VerticalTTT6x6.bmp" "images\Vertical_TicTacToe\VerticalTTT6x6.bmp")
        (grid
            (common-grid-stuff)
            (dimensions
                ("a/b/c/d/e/f" (45 0)) ; columns
                ("6/5/4/3/2/1" (0 45)) ; rows
			)
		)
	) 
)

(variant (title "-")) ; -----------------------------------------------

(variant
    (title "Vertical TicTacToe 7x5")
    (board
        (image "images\Vertical_TicTacToe\Shaag\VerticalTTT7x5.bmp" "images\Vertical_TicTacToe\VerticalTTT7x5.bmp")
        (grid
            (common-grid-stuff)
            (dimensions ; 7x6
                ("a/b/c/d/e/f/g" (45 0)) ; columns
                ("5/4/3/2/1" (0 45)) ; rows
			)
		)
	) 
	(piece
        (common-piece-stuff)
        (drops
            (pile a1) (pile b1) (pile c1) (pile d1) (pile e1) (pile f1) (pile g1)
		)
	)
)

(variant
    (title "Vertical TicTacToe 7x6")
	(default)
    (board
        (image "images\Vertical_TicTacToe\Shaag\VerticalTTT7x6.bmp" "images\Vertical_TicTacToe\VerticalTTT7x6.bmp")
        (grid
            (common-grid-stuff)
            (dimensions ; 7x6
                ("a/b/c/d/e/f/g" (45 0)) ; columns
                ("6/5/4/3/2/1" (0 45)) ; rows
			)
		)
	) 
    (piece
        (common-piece-stuff)
        (drops
            (pile a1) (pile b1) (pile c1) (pile d1) (pile e1) (pile f1) (pile g1)
		)
	)
)

(variant
    (title "Vertical TicTacToe 7x7")
    (board
        (image "images\Vertical_TicTacToe\Shaag\VerticalTTT7x7.bmp" "images\Vertical_TicTacToe\VerticalTTT7x7.bmp")
        (grid
            (common-grid-stuff)
            (dimensions ; 7x6
                ("a/b/c/d/e/f/g" (45 0)) ; columns
                ("7/6/5/4/3/2/1" (0 45)) ; rows
			)
		)
	) 
    (piece
        (common-piece-stuff)
        (drops
            (pile a1) (pile b1) (pile c1) (pile d1) (pile e1) (pile f1) (pile g1)
		)
	)
)

(variant (title "-")) ; -----------------------------------------------

(variant
    (title "Vertical TicTacToe 8x5")
    (board
        (image "images\Vertical_TicTacToe\Shaag\VerticalTTT8x5.bmp" "images\Vertical_TicTacToe\VerticalTTT8x5.bmp")
        (grid
            (common-grid-stuff)
            (dimensions
                ("a/b/c/d/e/f/g/h" (45 0)) ; columns
                ("5/4/3/2/1" (0 45)) ; rows
			)
		)
	) 
    (piece
        (common-piece-stuff)
        (drops
            (pile a1) (pile b1) (pile c1) (pile d1) (pile e1) (pile f1) (pile g1) (pile h1)
		)
	)
)

(variant
    (title "Vertical TicTacToe 8x6")
    (board
        (image "images\Vertical_TicTacToe\Shaag\VerticalTTT8x6.bmp" "images\Vertical_TicTacToe\VerticalTTT8x6.bmp")
        (grid
            (common-grid-stuff)
            (dimensions
                ("a/b/c/d/e/f/g/h" (45 0)) ; columns
                ("6/5/4/3/2/1" (0 45)) ; rows
			)
		)
	) 
    (piece
        (common-piece-stuff)
        (drops
            (pile a1) (pile b1) (pile c1) (pile d1) (pile e1) (pile f1) (pile g1) (pile h1)
		)
	)
)

(variant
    (title "Vertical TicTacToe 8x7")
    (board
        (image "images\Vertical_TicTacToe\Shaag\VerticalTTT8x7.bmp" "images\Vertical_TicTacToe\VerticalTTT8x7.bmp")
        (grid
            (common-grid-stuff)
            (dimensions
                ("a/b/c/d/e/f/g/h" (45 0)) ; columns
                ("7/6/5/4/3/2/1" (0 45)) ; rows
			)
		)
	) 
    (piece
        (common-piece-stuff)
        (drops
            (pile a1) (pile b1) (pile c1) (pile d1) (pile e1) (pile f1) (pile g1) (pile h1)
		)
	)
)

(variant
    (title "Vertical TicTacToe 8x8")
    (board
        (image "images\Vertical_TicTacToe\Shaag\VerticalTTT8x8.bmp" "images\Vertical_TicTacToe\VerticalTTT8x8.bmp")
        (grid
            (common-grid-stuff)
            (dimensions
                ("a/b/c/d/e/f/g/h" (45 0)) ; columns
                ("8/7/6/5/4/3/2/1" (0 45)) ; rows
			)
		)
	) 
    (piece
        (common-piece-stuff)
        (drops
            (pile a1) (pile b1) (pile c1) (pile d1) (pile e1) (pile f1) (pile g1) (pile h1)
		)
	)
)

